package com.freesky.web.portal.reomte;

import com.freesky.common.utils.reponse.JSONResponse;
import com.freesky.web.portal.reomte.fallback.ItemRemoteFallback;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "emall-provider-zuul", fallback = ItemRemoteFallback.class)
public interface ItemRemote {
    String ZUUL_URL_PREFIX ="/mysevice/order";
    String URL_PREFIX = "/item";

    @GetMapping(value = ZUUL_URL_PREFIX+URL_PREFIX+"/detail")
    JSONResponse getItemDetail(@RequestParam(value = "productId") String id);

    @GetMapping(value = ZUUL_URL_PREFIX+"/item/get_all")
    JSONResponse getAll(
            @RequestParam(value = "page",defaultValue = "1") int page,
            @RequestParam(value = "size",defaultValue = "20") int size,
            @RequestParam(value = "sort",defaultValue = "") String sort,
            @RequestParam(value = "cid",defaultValue = "") Long cid,
            @RequestParam(value = "priceGt",defaultValue = "-1") int priceGt,
            @RequestParam(value = "priceLte",defaultValue = "-1") int priceLte);
}
